// 1. 导入页面所需依赖资源（React核心、UI组件、工具函数等）
import React from 'react';
import { Card, Tabs } from 'antd';
import type { TabsProps } from 'antd';
import FoundationCard from './trusscard/FoundationCard';
import ColunmReinforcementCard from './trusscard/ColunmReinforcementCard';
import WeldCard from './trusscard/WeldCard';
import RectangularTrussMultiCard from './trusscard/RectangularTrussMultiCard';
import InvertedTrussMultiCard from './trusscard/InvertedTriangularTrussMultiCard';
import StatisticsCard from './trusscard/StatisticsCard';


// 5. 定义页面组件
const Truss: React.FC = () => {
  // 定义主Tabs结构
  const tabItems: TabsProps['items'] = [
    { key: 'foundation', label: '地基基础计算', children: <FoundationCard /> },
    { 
      key: 'trussCapacity', 
      label: '桁架承载力计算', 
      children: (
        <Tabs defaultActiveKey="rectangular-truss" items={[
          { 
            key: 'rectangular-truss', 
            label: '矩形桁架', 
            children: <RectangularTrussMultiCard />
          },
          { 
            key: 'equilateral-truss', 
            label: '正三角形桁架', 
            children: <div style={{ padding: '16px 0' }}>暂无计算配置</div>
          },
          { 
            key: 'inverted-truss', 
            label: '倒三角形桁架', 
            children: <InvertedTrussMultiCard />
          }
        ]} />
      ) 
    },
    { key: 'weld', label: '焊缝计算', children: <WeldCard />},
    { key: 'colunmReinforcement', label: '配筋计算', children: <ColunmReinforcementCard />},
    { key: 'truss-stastic', label: '桁架材料统计', children: <StatisticsCard />}
  ];

  return (
    <Card title="隧道跨越桁架计算">
      <Tabs defaultActiveKey="foundation" items={tabItems} />
    </Card>
  );
};

export default Truss;